<template>
  <el-menu 
  :default-active="newurl"
    class="el-menu-vertical-demo"
   
    background-color="#D3DCE6"
    text-color="#fff"
    active-text-color="#000"
    router>
    <el-menu-item index="/xiaoshou" @click="fun('/xiaoshou')">
    
    <span slot="title">菜品销售</span>
    </el-menu-item>
    <el-menu-item index="/liushui" @click="fun('/liushui')">
    
    <span slot="title">营收流水</span>
    </el-menu-item>

  </el-menu>
</template>

<script>
export default {
    methods: {
      fun(url){
        window.localStorage.setItem("url",url)
      }
    },
    computed:{
      newurl(){
        if(window.localStorage.getItem("url") != null){
          return window.localStorage.getItem("url")
        }else{
          return "/xiaoshou"
        }
      }
    }
  
};
</script>

<style>
</style>